/**
 * @file human_ai_terminal.h
 * @brief Terminal for human to send commands to AI
 */

#ifndef HUMAN_AI_TERMINAL_H
#define HUMAN_AI_TERMINAL_H

#include "ai_communication_protocol.h"
#include "stlstrings.h"
#include <vector>
#include <queue>

class HumanAITerminal
{
public:
    HumanAITerminal();
    
    bool StartTerminal();
    bool SendCommandToAI(const wxString& command, const std::map<wxString, wxString>& parameters = {});
    bool SendDataToAI(const wxString& data, ContentType contentType = ContentType::TEXT);
    bool ReceiveFromAI(AIMessage& message, int timeout_ms = 5000);
    bool HasResponseFromAI();
    void StartInteractiveDialog();
    void ExecuteBatchCommands(const std::vector<wxString>& commands);
    const std::vector<AIMessage>& GetConversationHistory() const { return m_conversationHistory; }

private:
    std::queue<AIMessage> m_outgoingQueue;
    std::queue<AIMessage> m_incomingQueue;
    std::vector<AIMessage> m_conversationHistory;
    
    AIMessage ParseHumanInput(const wxString& input);
    void DisplayAIResponse(const AIMessage& response);
    void ShowHelp();
};

#endif
